<div class="col-lg-12">
    <h1 class="page-header">Danh sách bản tin</h1>
</div>
<div class="col-lg-12">
    <a href="<?php echo Yii::app()->createUrl('news/add')?>" class="btn btn-success margin-20">Thêm bản tin mới >> </a>
    <table class="items table table-bordered">
        <tr style="background: #428bca;color: #fff">
            <th width="50">#</th>
            <th>Hỉnh ảnh</th>
            <th>Tiêu đề</th>
            <th>Danh mục</th>
            <th>Thứ tự</th>
            <th>Sửa</th>
            <th>Xóa</th>
        </tr>
        <?php $form = $this->beginWidget('booster.widgets.TbActiveForm',
                array(
                    'id' => 'verticalForm',
                    'method' => 'get',
                    'htmlOptions' => array('method' => 'get'), // for inset effect
                )); 
        ?>
        <tr class="container-search">
                <td></td>
                <td></td>
                <td>
                    <?php
                        echo $form->textFieldGroup($NewsSearch, 'title',array('labelOptions' => array("label" => false)));
                    ?>
                </td>
                <td>
                    <?php
                    $taxonomy = array(0 => 'tất cả');
                    $taxonomy = array_merge($taxonomy,Taxonomy::getListTaxonomy(ROOT_CATEGORY));
                    echo $form->dropDownListGroup(
                            $NewsSearch, 'taxonomy_id', array(
                                'labelOptions' => array("label" => false),
                                'widgetOptions' => array(
                                    'data' => $taxonomy,
                                )
                             )
                    );
                    ?>
                </td>
                <td></td>
                <td colspan="2">
                    <input  value="tìm kiếm" class="btn btn-danger" type="submit"/>
                </td>
        </tr>
        <?php $this->endWidget(); ?>
        
        <?php foreach($newses as $news):?>
        <tr>
            <td><?php echo $news->news_id?></td>
            <td><img src="<?php echo urlImageFolder('news').$news->getImage()?>" class="product_image" height="50"/></td>
            <td><?php echo $news->title?></td>
            <td><?php echo $news->taxonomy->name?></td>
            <td><?php echo $news->order?></td>
            <td>
                <a class="update" title="" data-toggle="tooltip" href="<?php echo Yii::app()->createUrl('news/update',array('id' => $news->news_id))?>" data-original-title="Update">
                    <i class="glyphicon glyphicon-pencil"></i>
                </a>
            </td>
            <td>
                <a class="delete" title="" data-toggle="tooltip" href="<?php echo Yii::app()->createUrl('news/delete',array('id' => $news->news_id))?>" data-original-title="Delete">
                    <i class="glyphicon glyphicon-trash"></i>
                </a>
                
            </td>
        </tr>
        <?php endforeach;?>
        
    </table>
    <?php $this->widget('CLinkPager', array(
                    'pages' => $pages,
                    'prevPageLabel'=>'<<',
                    'nextPageLabel'=>'>>',
                    'header'=>'',
                    'lastPageLabel' => 'Sau cùng',
                    'firstPageLabel' => 'Đầu tiên',
                    'htmlOptions'=>array('class'=>'pagination')
        )); 
    ?>
</div>